package com.example.demo.dao;/**
 * @author Daog
 * @create 2020 -11 -2020-11-02 23:07
 * @description 功能描述
 */

import com.example.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @program: demo_boot
 *
 * @description:
 *
 * @author: Dong
 *
 * @create: 2020-11-02 23:07
 **/
@Mapper
public interface UserDao {

    @Insert("insert into user(name,age) values(#{name},#{age})")
    public void save (User user);

    @Update("update user set name=#{name},age=#{age} where id=#{id}")
    public void update(User user);

    @Delete("deleat from user where id=#{id}")
    public void delete(Long id);


    @Select("select *from user")
    public List<User> getAll();

    @Select("select* from user where id=#{id}")
    public User findOne(Long id);
}
